package model.semantics;

import java.util.List;

import model.State;
import model.TurtleState;

/**
 * Represents a generic binary operation.
 * @author Sterling Dorminey
 */
public abstract class BinaryOperation extends Operation<Integer> {

	public BinaryOperation() {
		super(2);
	}
	
	@Override
	protected Integer evaluateSafely(State<Integer> state, List<Integer> values) {
		return evaluateValue((TurtleState)state, values.get(0), values.get(1));
	}

    /**
     * Given a value, transform it into a new value.
     * 
     */
    protected abstract Integer evaluateValue(TurtleState state, Integer value1, Integer value2);
}
